package method.GPS;

import view.Core.R;
import android.app.Activity;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.view.*;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class mainActivity extends Activity {
	private static final int REQUEST_CODE = 3434;
	
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Intent i = new Intent(this, UseGPS_BActivity.class);
		startActivityForResult(i, REQUEST_CODE);
	}

	public void onGetXY(View view) {
		//Toast.makeText(this, "xx", Toast.LENGTH_LONG).show();
		Intent i = new Intent(this, UseGPS_BActivity.class);
		startActivityForResult(i, REQUEST_CODE);
		
		//Intent i = new Intent(this, CopyOfmainActivityB.class);
		//startActivity(i);
	}
	
	
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		if (resultCode == RESULT_OK && requestCode == REQUEST_CODE) {
			if (data.hasExtra("longitude")) {
				
				String longitude = data.getExtras().getString("longitude");
				String latitude = data.getExtras().getString("latitude");
				Toast.makeText(this, longitude + ", "+latitude, Toast.LENGTH_LONG).show();

			}
		}
	}
}